label: Move if statement where it makes sense
authorTimm Bäder <mail@baedert.org>
Tue, 25 Apr 2017 13:45:37 +0000 (15:45 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 25 Apr 2017 18:30:37 +0000 (20:30 +0200)
In the else branch of the if statement before this one, we're assigning
*smallest = *widest anyway, so this if statement is never true. Move it
to the if block before instead, where it can apply.

gtk/gtklabel.c

index b3111dd50b4ca1e3c0e491fc2500d14499c3370f..f4c39e44c582e7ea42fbfa87c256ad496d7c8f79 100644 (file)
@@ -3703,15 +3703,15 @@ gtk_label_get_preferred_layout_size (GtkLabel *label,
           widest->width = MAX (widest->width, char_pixels * priv->width_chars);
           widest->x = widest->y = 0;
         }
+
+      if (widest->width < smallest->width)
+        *smallest = *widest;
     }
   else
     {
       *smallest = *widest;
     }
 
-  if (widest->width < smallest->width)
-    *smallest = *widest;
-
   g_object_unref (layout);
 }